package com;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class UserAddressData {


    /**
     * success : true
     * data : [{"id":12,"uid":76,"name":"礼拜二","phone":"15537417579","areaFirst":"{\"id\":11,\"name\":\"北京\"}","areaSecond":"{\"id\":1101,\"name\":\"市辖区\"}","areaThree":"{\"id\":110102,\"name\":\"西城区\"}","address":"北京市 市辖区 东城区。。。。。。","def":0,"status":0,"ctime":1591090860343,"utime":1591090860343},{"id":11,"uid":76,"name":"礼拜二","phone":"15537417579","areaFirst":"{\"id\":11,\"name\":\"北京\"}","areaSecond":"{\"id\":1101,\"name\":\"市辖区\"}","areaThree":"{\"id\":110101,\"name\":\"东城区\"}","address":"北京市 市辖区 东城区。。。。。。","def":1,"status":0,"ctime":1591090798870,"utime":1591090798870}]
     * code : 0
     */

    private boolean success;
    private int code;
    private List<DataBean> data;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean implements Parcelable , Comparable<DataBean> {
        /**
         * id : 12
         * uid : 76
         * name : 礼拜二
         * phone : 15537417579
         * areaFirst : {"id":11,"name":"北京"}
         * areaSecond : {"id":1101,"name":"市辖区"}
         * areaThree : {"id":110102,"name":"西城区"}
         * address : 北京市 市辖区 东城区。。。。。。
         * def : 0
         * status : 0
         * ctime : 1591090860343
         * utime : 1591090860343
         */

        private int id;
        private int uid;
        private String name;
        private String phone;
        private String areaFirst;
        private String areaSecond;
        private String areaThree;
        private String address;
        private int def;
        private int status;
        private long ctime;
        private long utime;

        protected DataBean(Parcel in) {
            id = in.readInt();
            uid = in.readInt();
            name = in.readString();
            phone = in.readString();
            areaFirst = in.readString();
            areaSecond = in.readString();
            areaThree = in.readString();
            address = in.readString();
            def = in.readInt();
            status = in.readInt();
            ctime = in.readLong();
            utime = in.readLong();
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel in) {
                return new DataBean(in);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getUid() {
            return uid;
        }

        public void setUid(int uid) {
            this.uid = uid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getAreaFirst() {
            return areaFirst;
        }

        public void setAreaFirst(String areaFirst) {
            this.areaFirst = areaFirst;
        }

        public String getAreaSecond() {
            return areaSecond;
        }

        public void setAreaSecond(String areaSecond) {
            this.areaSecond = areaSecond;
        }

        public String getAreaThree() {
            return areaThree;
        }

        public void setAreaThree(String areaThree) {
            this.areaThree = areaThree;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public int getDef() {
            return def;
        }

        public void setDef(int def) {
            this.def = def;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public long getCtime() {
            return ctime;
        }

        public void setCtime(long ctime) {
            this.ctime = ctime;
        }

        public long getUtime() {
            return utime;
        }

        public void setUtime(long utime) {
            this.utime = utime;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(id);
            dest.writeInt(uid);
            dest.writeString(name);
            dest.writeString(phone);
            dest.writeString(areaFirst);
            dest.writeString(areaSecond);
            dest.writeString(areaThree);
            dest.writeString(address);
            dest.writeInt(def);
            dest.writeInt(status);
            dest.writeLong(ctime);
            dest.writeLong(utime);
        }


        @Override
        public int compareTo(DataBean o) {
            return o.getDef()-def;
        }
    }
}
